﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using POSSystem.DAL;

namespace POSSystem.BLL
{
    public class PaymentMethod : _PaymentMethod
    {
        public const int BankTransfer = 2;
        public const int PayPal = 6;
        public static PaymentMethod GetAllMethods()
        {
            try
            {
                PaymentMethod method = new PaymentMethod();
                method.LoadAll();
                return method;
            }
            catch (Exception ex)
            {
                ErrorLog.WriteToFile("PaymentMethod.cs", "GetAllMethods", ex.StackTrace);
                throw ex;
            }
        }

        public static PaymentMethod GetAllMethods(string type)
        {
            try
            {
                PaymentMethod method = new PaymentMethod();
                method.Where.MethodType.Value = type;
                method.Query.Load();
                return method;
            }
            catch (Exception ex)
            {
                ErrorLog.WriteToFile("PaymentMethod.cs", "GetAllMethods", ex.StackTrace);
                throw ex;
            }
        }
    }
}
